import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 意见反馈信息 */
export interface Feedback {
          id: number; // 医生ID
          content?: string; // 意见反馈内容
          images: string; // 意见反馈图片
  }

// 意见反馈 API
export const FeedbackApi = {
  // 查询意见反馈分页
  getFeedbackPage: async (params: any) => {
    return await request.get({ url: `/business/feedback/page`, params })
  },

  // 查询意见反馈详情
  getFeedback: async (id: number) => {
    return await request.get({ url: `/business/feedback/get?id=` + id })
  },

  // 新增意见反馈
  createFeedback: async (data: Feedback) => {
    return await request.post({ url: `/business/feedback/create`, data })
  },

  // 修改意见反馈
  updateFeedback: async (data: Feedback) => {
    return await request.put({ url: `/business/feedback/update`, data })
  },

  // 删除意见反馈
  deleteFeedback: async (id: number) => {
    return await request.delete({ url: `/business/feedback/delete?id=` + id })
  },

  /** 批量删除意见反馈 */
  deleteFeedbackList: async (ids: number[]) => {
    return await request.delete({ url: `/business/feedback/delete-list?ids=${ids.join(',')}` })
  },

  // 导出意见反馈 Excel
  exportFeedback: async (params) => {
    return await request.download({ url: `/business/feedback/export-excel`, params })
  },
}